﻿using System.Collections.Generic;

namespace Spectro.Cards
{
    /// <summary>
    /// Essense in card game
    /// </summary>
    public abstract class Warior : IEssence
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        public string Name
        {
            get
            {
                return this.GetType().Name;
            }
        }

        /// <summary>
        /// Gets or sets the health.
        /// </summary>
        /// <value>
        /// The health.
        /// </value>
        public int Health { get; set; }

        /// <summary>
        /// Gets or sets the position.
        /// </summary>
        /// <value>
        /// The position.
        /// </value>
       public int Position { get; set; }

       /// <summary>
       /// Gets the actions.
       /// </summary>
       /// <param name="attaker">The attaker.</param>
       /// <param name="defender">The defender.</param>
        public abstract IEnumerable<IAction> GetActions(Gamer attaker, Gamer defender);

        /// <summary>
        /// Gets the filters.
        /// </summary>
        /// <param name="attaker">The attaker.</param>
        /// <param name="defender">The defender.</param>
        public virtual IEnumerable<IFilter> GetFilters(Gamer attaker, Gamer defender)
        {
            return new List<IFilter>();
        }

        /// <summary>
        /// Determines whether [is can execute ection] [the specified action].
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="attaker">The attaker.</param>
        /// <param name="defender">The defender.</param>
        /// <returns>
        ///   <c>true</c> if [is can execute ection] [the specified action]; otherwise, <c>false</c>.
        /// </returns>
        public virtual bool IsCanExecuteEction(IAction action, Gamer attaker, Gamer defender)
        {
            return true;
        }

        /// <summary>
        /// Afters the attack.
        /// </summary>
        /// <param name="attaker">The attaker.</param>
        /// <param name="defender">The defender.</param>
        public virtual void AfterAttack(Gamer attaker, Gamer defender)
        {
            
        }

        /// <summary>
        /// Dies the specified Warior.
        /// </summary>
        /// <param name="attaker">The attaker.</param>
        /// <param name="defender">The defender.</param>
        public virtual IEssence Die(Gamer attaker, Gamer defender)
        {
            //any opration with Gamer where die
            return null;
        }
    }
}